﻿
/****** Object:  User Defined Function dbo.IntreDatele    Script Date: 22/02/2006 5:44:11 PM ******/
CREATE FUNCTION InainteDeData (@Valoare DECIMAL(20,2), @dataStart datetime,@dataVerificata datetime)  
RETURNS DECIMAL(20,2) AS  
BEGIN 
	DECLARE @ret DECIMAL(20,2)
	SET @ret = 0
	if @dataStart is NULL
		 SET @ret = @Valoare
	ELSE
	BEGIN
		if @dataVerificata < @dataStart 
			SET @ret = @Valoare
	END
	RETURN @ret	
END